using System;
using System.Collections.Generic;
using System.Text;
using Microsoft.Xna.Framework;
using Microsoft.Xna.Framework.Graphics;
using BoOnce.Helpers;

namespace BoOnce.Components
{
    public class PauseComponent : DrawableGameComponent
    {
        private SpriteBatch _SpriteBatch;
        private SpriteFont _Font;

        public PauseComponent(Game game)
            : base(game)
        {
        }

        public override void Initialize()
        {

            _SpriteBatch = new SpriteBatch(Game.GraphicsDevice);
            Logger.WriteInfo("PauseComponent[#" + this.UpdateOrder + "] init");
            base.Initialize();
        }

        public override void Update(GameTime gameTime)
        {
            base.Update(gameTime);
        }

        protected override void LoadContent()
        {
            _Font = Game.Content.Load<SpriteFont>("Fonts/Arial8");
        }

        public override void Draw(GameTime gameTime)
        {
            if (BaseGame.Pause)
            {
                _SpriteBatch.Begin();
                _SpriteBatch.DrawString(_Font, "Pause !", new Vector2(Settings.SCREEN_X / 2, Settings.SCREEN_Y / 2), Color.White);
                _SpriteBatch.End();
            }
        }
    }
}
